﻿#ifndef CALIBRATION_BUSINESSLOGIC_FRESHBLOODCALIBRATION_H
#define CALIBRATION_BUSINESSLOGIC_FRESHBLOODCALIBRATION_H

#include <QObject>
#include "Interface/Count.h"
#include "Calibration/Model/FreshBloodViewModel.h"


#define CALIBRATE_COUNT    12

class FreshBloodCalibration : public Count
{
    Q_OBJECT
public:
    FreshBloodCalibration(QObject *parent = 0);
    void doInit();
    void doUnInit();
    void viewDataInit();
    void setData(QVariant data);
    void setCountResult(const CountResultDao &countResult);
    bool paramCheck();
    //校正完成
    bool calibrationCompeleted();
    //校正结果有效
    bool calibrationValid();
    //保存校正结果
    void calibrateResultSave();
    //清除中间数据
    void calibrateInit();
    //计算
    void calculate();


public slots:

private:
    FreshBloodViewModel mFreshBloodViewModel;
    FreshBloodViewModel::CalibrationParamValue calibBuffer[CALIBRATE_COUNT];
    int calibrateCount;
    bool calibrateCompele;
    bool calibrateValid;
};

#endif // CALIBRATION_BUSINESSLOGIC_FRESHBLOODCALIBRATION_H
